<?php
namespace App\Http\Controllers\Admin;

use App\Models\Securitycodein;
use App\Models\Securitycodeout;

Class SecuritycodeController extends BaseController{

    public function __construct(Securitycodein $securitycodein , Securitycodeout $securitycodeout)
    {
        parent::__construct();
        $this->securitycode = $securitycodein;
        $this->securitycodeout = $securitycodeout;
    }

    // 得到出库码
    public function getSecurityCodeOut(){
        $res = $this->securitycodeout->getSecurityList(request());
        //dd($res);
        //return ajax_return($res);
        $flag = 'sec';
        return view('agent.seccode.codeout',compact('res','flag'));
    }



    //仓库防伪码 入库码
    public function getSecurityCodeList(){
         $res = $this->securitycode->getSecurityList(request());
         //dd($res);
         $flag = 'sec';
         return view('agent.seccode.code',compact('res','flag'));
    }

    // 生成防伪码
    public function getCreateSecuritycode(){
          $res = $this->securitycode->creatSecurity(request());
          return ajax_return($res);
    }

    // 保存防伪码
    public function postAddSecurityCode(){
          $res = $this->securitycode->saveSecurity(request());
          return ajax_return($res);
    }
}